@REM 指定编码为utf-8
chcp 65001

@REM V0.0.1-2022-12-22
@echo off
:获取管理员权限
%1 mshta vbscript:CreateObject("Shell.Application").ShellExecute("cmd.exe","/c %~s0 ::","","runas",1)(window.close)&&exit
:保持当前目录下运行
cd /d "%~dp0"

@REM 删除旧版插件
rmdir /s/q "C:\Program Files\Common Files\Adobe\CEP\extensions\CoolorusForAdobeAI"

@REM 修改注册表,启用debug模式
reg add HKEY_CURRENT_USER\Software\Adobe\CSXS.11 /v PlayerDebugMode /t REG_SZ /d "1" /f
reg add HKEY_CURRENT_USER\Software\Adobe\CSXS.12 /v PlayerDebugMode /t REG_SZ /d "1" /f

@REM 解压插件到当前目录
"7z\7z.exe" x CoolorusForAdobeAI.7z -aoa -o"CoolorusForAdobeAI"

@REM 复制插件到CEP目录
xcopy /y /s CoolorusForAdobeAI\ "C:\Program Files\Common Files\Adobe\CEP\extensions\CoolorusForAdobeAI\"

@REM 清理脚本文件夹
rmdir /s/q CoolorusForAdobeAI

@REM 调用清理脚本（For Dev）
cd ..
cd ..
call 清理build文件夹.bat
